<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core-rt" prefix="c-rt" %>
<%@ taglib uri="http://java.jeffheaton.com/taglib/jstl/forum" prefix="forum" %>

<forum:expire>
  <c:redirect url="index.jsp" />
</forum:expire>

<c:if test="${user.type!='A'}">
  <c:redirect url="main.jsp" />
</c:if>

<c:if test="${pageContext.request.method=='POST'}">
  <c:if test="${param.cancel!=null}">
    <c:redirect url="admin.jsp" />
  </c:if>

  <forum:editForum code="${param.code}"
  sequence="${param.seq}"
  name="${param.name}"/>

  <c:redirect url="admin.jsp" />
</c:if>

<html>
  <head>
    <title><fmt:message key="editforum.title" bundle="${lang}"/></title>
  </head>

  <body>
    <forum:loadForum var="row" code="${param.target}"/>

    <table border="0">
      <form method="post">
        <tr>
          <td colspan="2" bgcolor="#0000FF">
            <p align="center">
              <b>
                <font size="4" color="#FFFFFF"><fmt:message key="editforum.title" bundle="${lang}"/></font>
              </b>
            </p>
          </td>
        </tr>

        <tr bgcolor="#FFFF66">
          <td><fmt:message key="editforum.code" bundle="${lang}"/></td>

          <td>
          <c:out value="${row.code}" />

          <input type="hidden" name="code"
          value="<c:out value="${row.code}"/>"/>
          </td>
        </tr>

        <tr>
          <td><fmt:message key="editforum.name" bundle="${lang}"/></td>

          <td>
          <input type="text" name="name" value="<c:out value="${row.name}"/>" 
          size="20" width="10"/>
          </td>
        </tr>
        <tr bgcolor="#FFFF66">
          <td><fmt:message key="editforum.number" bundle="${lang}"/></td>

          <td>
          <input type="text" value="<c:out value="${row.sequence}"/>" 
          size="20" name="seq" width=10></td>
        </tr>

        <tr>
          <td colspan="2">
            <center>
              <input type="submit" name="save" value="<fmt:message key="button.save" bundle="${lang}"/>" />

              <input type="submit" name="cancel"
              value="<fmt:message key="button.cancel" bundle="${lang}"/>" />
            </center>
          </td>
        </tr>
      </form>
    </table>

  </body>
</html>

